<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ContactManager.Models.Group>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Index</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table class="data-table">
    <thead>
        <tr>
            <th class="actions">
                Actions  
            </th>
            <th>
                Group Name
            </th>
        </tr>
    </thead>
    <tbody>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td class="actions delete">
                <a href='<%= Url.Action("Delete", new {id=item.Id}) %>'><img src="../../Content/Delete.png" alt="Delete" /></a>
            </td>
            <td>
                <%= Html.Encode(item.Name) %>
            </td>
        </tr>
    
    <% } %>

    <tr>
        <% using (Html.BeginForm("Create", "Group"))
           { %>
        <td class="actions">
            Add
        </td>
        <td>
            <%= Html.TextBox("Name") %><input type="submit" value="Create" />
        </td>
        <% } %>
    </tr>

    </tbody>
    </table>



</asp:Content>

